<?php

/**
 * Camelot PHP Tools Settings file
 *
 * @version 2.0
 * @author Bendsoft
 * @package PHP Tools
 * @subpackage Camelot
 * @license FreeBSD License (www.bendsoft.com/licensing/)
 *
 */


/************* IN & OUT *************/
define("USE_WCF_CACHE", FALSE);
define("SILENT_EXCEPTIONS", FALSE);

$WcfSettingsList = WcfSettingsList::instance();
$WcfSettingsList->appendSettings(new WcfSettingsObject("SharePointConnection3", "http://dev1.bendsoft.com:8080/?wsdl", "MySharedKey", "sharepoint_connection", 0, "ntlm"));
$WcfSettingsList->appendSettings(new WcfSettingsObject("SharePointConnection2", "http://php01.bendsoft.net:8080/?wsdl", "MySharedKey", "sharepoint_connection2", 0));
$WcfSettingsList->appendSettings(new WcfSettingsObject("SharePointConnection1", "http://php01.bendsoft.net:8080/?wsdl", "MySharedKey", "sharepoint_connection2", 0));

// Set static NTLM_CREDENTIALS, check documentation for more details
// http://docs.bendsoft.com/camelot-php-tools/latest/examples-and-tutorials/ntlm-authentication/
//$GLOBALS['NTLM_CREDENTIALS'] = array(
//    'ntlm_username' => 'ntlm_username',
//    'ntlm_password' => 'ntlm_password'
//);


/************* UPLOADING *************/
/* Allowed filetypes, * for all otherwise a comma (,) separated list */
define("FILE_TYPES", "*"); // doc,docx,xls,xlsx,jpg,png

/* MAX file size in bytes, default 50mb (52428800), set to * for no limit */
define("FILE_SIZE", "52428800");


/************* GENERIC ************ */
/* Where to store temporary files (let's get the default from php.ini) */
define("TEMP_DIR", ini_get('upload_tmp_dir'));
if (constant("TEMP_DIR") == "")
    echo "Warning: You must set the upload_tmp_dir in php.ini or in the settings file";

/* Set WSDL Caching */
if (USE_WCF_CACHE) {
    ini_set("soap.wsdl_cache_enabled", '1');
    ini_set('soap.wsdl_cache_ttl', '1');
} else {
    ini_set("soap.wsdl_cache_enabled", '0');
    ini_set('soap.wsdl_cache_ttl', '0');
}

/* Time format */
define("NOW", date('Y-m-d H:i:s'));

/* Whos doing what */
define("IP", $_SERVER['REMOTE_ADDR']);

/* Global delimiter */
define("DELIMITER", ",");

/************* DATABASE ************ */
define("DATABASE_TYPE", "mysql");
define("DATABASE_NAME", "php_tools");
define("DATABASE_USER", "username");
define("DATABASE_PASSWORD", "password");
define("DATABASE_HOST", "localhost");
define("DATABASE_PORT", "3306");
define("DATABASE_PREFIX", "");


/************* POST FILE SETTINGS ************ */
define("POST_SHARED_KEY", "MySharedKey");


/************* EXCEPTIONS ************ */
$exceptions = CamelotExceptionList::instance();

// CamelotSoap messages
$exceptions->appendSettings(new CamelotExceptionObject(400, "Camelot XML missing"));
$exceptions->appendSettings(new CamelotExceptionObject(401, "Query missing"));
$exceptions->appendSettings(new CamelotExceptionObject(402, "No WSDL Service address is set"));
$exceptions->appendSettings(new CamelotExceptionObject(403, "No listName or query is set"));
$exceptions->appendSettings(new CamelotExceptionObject(404, "Packet data missing"));
$exceptions->appendSettings(new CamelotExceptionObject(405, "There cannot exist more than one command (sql / listName / count)"));
$exceptions->appendSettings(new CamelotExceptionObject(406, "Missing internal connection name, set the connection_name argument or property"));
$exceptions->appendSettings(new CamelotExceptionObject(407, "Count query missing"));
$exceptions->appendSettings(new CamelotExceptionObject(408, "Could not parse the command object"));
$exceptions->appendSettings(new CamelotExceptionObject(409, "The Camelot XML is in an incorrect format or possibly corrupt."));
$exceptions->appendSettings(new CamelotExceptionObject(410, "Could not open cached file"));
$exceptions->appendSettings(new CamelotExceptionObject(411, "Error when fetching the data, is the client initialized?"));

// CamelotXMLSorting messages
$exceptions->appendSettings(new CamelotExceptionObject(500, "Missing content input or no data in string"));
$exceptions->appendSettings(new CamelotExceptionObject(501, "Missing sorting array (No columns have matching rows in the result set)"));
$exceptions->appendSettings(new CamelotExceptionObject(502, "Missing sorting schema"));

// CamelotProcedures
$exceptions->appendSettings(new CamelotExceptionObject(600, "No file in uploader"));
$exceptions->appendSettings(new CamelotExceptionObject(601, "The uploaded file is bigger than the allowed maximum set in Camelot PHP Tools"));
$exceptions->appendSettings(new CamelotExceptionObject(602, "The uploaded filetype is not allowed by Camelot PHP Tools"));
$exceptions->appendSettings(new CamelotExceptionObject(603, "The uploaded file seem to be missing data"));
$exceptions->appendSettings(new CamelotExceptionObject(604, "Error in file upload"));
$exceptions->appendSettings(new CamelotExceptionObject(605, "Missing property value: listName; Please state the list or libraryname"));
$exceptions->appendSettings(new CamelotExceptionObject(606, "Missing property value: connection_name"));
$exceptions->appendSettings(new CamelotExceptionObject(607, "Missing property value: folder; Please state the foldername"));
$exceptions->appendSettings(new CamelotExceptionObject(608, "Missing property value: contentType; Please state the contenttype name"));
$exceptions->appendSettings(new CamelotExceptionObject(609, "Missing property value: file; Please state the filename"));
$exceptions->appendSettings(new CamelotExceptionObject(610, "Missing property value: sourceListName; Please state the source listname"));
$exceptions->appendSettings(new CamelotExceptionObject(611, "Missing property value: sourceFile; Please state the source filename and path"));
$exceptions->appendSettings(new CamelotExceptionObject(612, "Missing property value: destinationListName; Please state the destination listname"));
$exceptions->appendSettings(new CamelotExceptionObject(613, "Missing property value: destinationFile; Please state the destination filename and path"));
$exceptions->appendSettings(new CamelotExceptionObject(614, "Missing property value: checkInType; Please state the checkin type"));
$exceptions->appendSettings(new CamelotExceptionObject(615, "Missing property value: version; Please state the version number"));
$exceptions->appendSettings(new CamelotExceptionObject(616, "Missing property value: itemId; Please state the ID of the list item"));
$exceptions->appendSettings(new CamelotExceptionObject(617, "Missing property value: fileName; Please state the filename of the attachement"));
$exceptions->appendSettings(new CamelotExceptionObject(618, "Missing property value: data; Please set the bytearray"));
$exceptions->appendSettings(new CamelotExceptionObject(619, "Missing property value: fileName; The filename must be stated when uploading a byte array"));
$exceptions->appendSettings(new CamelotExceptionObject(620, "Could not retrieve the downloaded file(s), is your temp directory properly set up?"));
$exceptions->appendSettings(new CamelotExceptionObject(621, "Missing property value: columnNames; A minimum of one column name needs to be set"));

// WcfSettings & WcfSettingsList messages
$exceptions->appendSettings(new CamelotExceptionObject(800, "Could not get the requested setting"));


function pr($array) {
    echo "<xmp>";
    print_r($array);
    echo "</xmp>";
}

function prd($array) {
    echo "<xmp>";
    print_r($array);
    echo "</xmp>";
    die;
}

?>